using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace SailHero.Soft.FrameWork.Models.Mapping.AUTHCODEDBORA
{
    public class SYS_USERMap : EntityTypeConfiguration<SYS_USER>
    {
        public SYS_USERMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.USERID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.ACCOUNT)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.PASSWORD)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.USERCNAME)
                .HasMaxLength(20);

            this.Property(t => t.USERENAME)
                .HasMaxLength(20);

            this.Property(t => t.EMAIL)
                .HasMaxLength(20);

            this.Property(t => t.TELEPHONE)
                .HasMaxLength(20);

            this.Property(t => t.MOBILE)
                .HasMaxLength(20);

            this.Property(t => t.DEPARTID)
                .HasMaxLength(50);

            this.Property(t => t.BIRTHDAY)
                .HasMaxLength(50);

            this.Property(t => t.JOBNUMBER)
                .HasMaxLength(20);

            this.Property(t => t.ADDRESS)
                .HasMaxLength(50);

            this.Property(t => t.POSITION)
                .HasMaxLength(20);

            this.Property(t => t.LASTLOGINIP)
                .HasMaxLength(20);

            this.Property(t => t.ISENABLE)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.ISDELETE)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.ISONLINE)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.REMARK)
                .HasMaxLength(100);

            this.Property(t => t.CREATOR)
                .HasMaxLength(50);

            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("SYS_USER", "LYHADMIN");
            this.Property(t => t.USERID).HasColumnName("USERID");
            this.Property(t => t.ACCOUNT).HasColumnName("ACCOUNT");
            this.Property(t => t.PASSWORD).HasColumnName("PASSWORD");
            this.Property(t => t.USERCNAME).HasColumnName("USERCNAME");
            this.Property(t => t.USERENAME).HasColumnName("USERENAME");
            this.Property(t => t.EMAIL).HasColumnName("EMAIL");
            this.Property(t => t.TELEPHONE).HasColumnName("TELEPHONE");
            this.Property(t => t.MOBILE).HasColumnName("MOBILE");
            this.Property(t => t.DEPARTID).HasColumnName("DEPARTID");
            this.Property(t => t.SEX).HasColumnName("SEX");
            this.Property(t => t.BIRTHDAY).HasColumnName("BIRTHDAY");
            this.Property(t => t.JOBNUMBER).HasColumnName("JOBNUMBER");
            this.Property(t => t.ADDRESS).HasColumnName("ADDRESS");
            this.Property(t => t.POSITION).HasColumnName("POSITION");
            this.Property(t => t.LASTLOGINTIME).HasColumnName("LASTLOGINTIME");
            this.Property(t => t.LASTLOGINIP).HasColumnName("LASTLOGINIP");
            this.Property(t => t.ISENABLE).HasColumnName("ISENABLE");
            this.Property(t => t.ISDELETE).HasColumnName("ISDELETE");
            this.Property(t => t.ISONLINE).HasColumnName("ISONLINE");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
            this.Property(t => t.CREATOR).HasColumnName("CREATOR");
            this.Property(t => t.CREATETIME).HasColumnName("CREATETIME");
            this.Property(t => t.ISSUPER).HasColumnName("ISSUPER");
            this.Property(t => t.ID).HasColumnName("ID");
        }
    }
}
